package com.example.assetmanagement.common;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import lombok.Data;

@Data
public class PageRequest {
    @Min(value = 1, message = "页码必须>=1")
    private int page = 1;

    @Min(value = 1, message = "每页数量必须>=1")
    @Max(value = 100, message = "每页数量不能超过100")
    private int size = 10;

    public int getOffset() {
        return (page - 1) * size;
    }
} 